package com.lening.security.block;

import com.alibaba.csp.sentinel.slots.block.BlockException;
import lombok.extern.slf4j.Slf4j;

/**
 * @author 赵子豪
 * @date 2024年06月01日 15时28分17秒
 */
@Slf4j
public class BlockHandler {
    public static String  blockMethod(Long id, BlockException blockException){
        log.error("异常信息：{}",blockException.getMessage());
        return "限流了" + id;
    }

    public static String backMethod(Long id,Throwable e){
        log.error("运行时异常：{}",e.getMessage());
        return "fallback " + id;
    }
}